<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Audio
 *
 * @author vampired
 */
class Golib_Form_Staff extends Zend_Form{
    public function init()
    {
        $this->setAttrib('enctype', 'multipart/form-data');
        $this->setMethod('post');

        $title=new Zend_Form_Element_Text('title',array('label'=>'title','required'=>true,'size'=>50));
        $title->removeDecorator('DtDdWrapper')->addDecorator('HtmlTag', array(
                'tag' => 'dd'
            ));  
        $this->addElement($title);
        $name=new Zend_Form_Element_Text('name',array('label'=>'name','required'=>true,'size'=>50));
        $name->removeDecorator('DtDdWrapper')->addDecorator('HtmlTag', array(
                'tag' => 'dd'
            ));  
        $this->addElement($name);        
        $file=new Zend_Form_Element_File('file');
        $file->setLabel('picture')
             ->setDestination(ROOT_PATH.'/public/images/doctors')
        //ensure only 1 file
             ->addValidator('Count','false',1)
        //limit 100k
//        $file->addValidator('Size',false,5*102400);
        //only jpeg,png and gif
             ->addValidator('Extension',false,'jpg,jpeg,png,gif');
        $this->addElement($file,'file');
        
        $speciality=new Zend_Form_Element_Textarea('speciality',array('label'=>'speciality','required'=>true,'cols'=>50,'rows'=>5));
        $this->addElement($speciality);
        
        $about=new Zend_Form_Element_Textarea('about',array('label'=>'about','required'=>true,'cols'=>50,'rows'=>5));
        $this->addElement($about);
         
         $this->addElement('submit','submit',array(
         'label' => 'add doctor',
          ));
    }
}
